#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
executor.py
"""
from concurrent.futures import ThreadPoolExecutor

class Executor(ThreadPoolExecutor):
    """
    单例模式
    """
    _instance = None

    def __new__(cls, *args, **kwargs):
        if not getattr(cls, '_instance', None):
            thred_num = 10  # 线程池数量
            cls._instance = ThreadPoolExecutor(max_workers=thred_num)
        return cls._instance
